package com.dgw.Beans;

import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

/**
 * @program: spring-boot-webflux
 * @description:
 * @author: Mr.Dai
 * @create: 2019-11-26 20:43
 **/
@Component
public class HelloHandle {

    public static Mono<ServerResponse> hello(ServerRequest request){
        return ServerResponse.ok().contentType(MediaType.APPLICATION_PROBLEM_JSON)
                .body(BodyInserters.fromObject("hello This is Spring Boot WebFlux"));
    }
}
